package com.lzw.cpvideoplayer.mvp.presenter;

import android.content.Context;

import com.lzw.cpvideoplayer.mvp.model.BaseModel;
import com.lzw.cpvideoplayer.data.HeadData;
import com.lzw.cpvideoplayer.mvp.model.IModel;
import com.lzw.cpvideoplayer.data.cHeadData;
import com.lzw.cpvideoplayer.mvp.view.IBaseView;

public class VideoPresenter extends BaseVideoPresenter<IBaseView> {
    private IModel model;
    private static final String TAG = "VideoPresenter";
    public void fatch(Context context,String Url){
        model = new BaseModel();

     if(Url.substring(28,34).equals("search")){
         model.setOnLoadModel(context,Url, new IModel.onLoadModel<HeadData>() {
             @Override
             public void onLoadData(HeadData data) {
                 if(weak!=null) {
                     weak.get().ShowViewData(data);
                 }
             }
         },1);
     }else {
         model.setOnLoadModel(context,Url, new IModel.onLoadModel<cHeadData>() {
             @Override
             public void onLoadData(cHeadData data) {
                 if(weak!=null){
                     weak.get().ShowViewData(data);
                 }

             }
         },2);
     }



    }

}
